import requests

def face_compare_url(API_key,API_secret,image_url1,image_url2):
    """face++ 人脸对比接口函数(图片链接)"""
    face_compare_url = 'https://api-cn.faceplusplus.com/facepp/v3/compare'
    payload = {
        'api_key':API_key,
        'api_secret':API_secret,
        'image_url1':image_url1,
        'image_url2':image_url2,
    }
    r = requests.post(face_compare_url,payload)
    return r.json()

# def face_compare_file(API_key,API_secret,image_file1,image_file2):
#     """face++ 人脸对比接口函数(文件路径)"""
#     face_compare_url = 'https://api-cn.faceplusplus.com/facepp/v3/compare'
#     payload = {
#         'api_key':API_key,
#         'api_secret':API_secret,
#         'image_file1':image_file1,
#         'image_file2':image_file2,
#     }
#     r = requests.post(face_compare_url,payload)
#     return r.json()

def face_compare_token(API_key,API_secret,face_token1,face_token2):
    """face++ 人脸对比接口函数(face_token)"""
    face_compare_url = 'https://api-cn.faceplusplus.com/facepp/v3/compare'
    payload = {
        'api_key':API_key,
        'api_secret':API_secret,
        'face_token1':face_token1,
        'face_token2':face_token2,
    }
    r = requests.post(face_compare_url,payload)
    return r.json()